/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bground.game;

import bground.game.GL.Direction;
import bground.sprites.ExtendedSprite;
import java.util.Random;

/**
 *
 * @author s6_kustan_e
 */
public class AI extends I {

    Random r = new Random();

 
    /**
     * 
     * @param sprite
     */
    public void action(ExtendedSprite sprite) {
        int a = r.nextInt();
        if (a % 4== 0) {
            sprite.move(Direction.up);
            sprite.move(Direction.up);
        }
        if (a % 4== 1) {
            sprite.move(Direction.down);
            sprite.move(Direction.down);
        }
        if (a % 4== 2) {
            sprite.move(Direction.left);
            sprite.move(Direction.left);
        }
        if (a % 4 == 3) {
            sprite.move(Direction.right);
            sprite.move(Direction.right);
        }
        if (a % 16 == 0) {
            sprite.fire();
        }

    }
}
